﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.Composite.Modularity;
using Microsoft.Practices.Composite.Regions;
using Microsoft.Practices.Unity;

namespace DiscoveryLogic.Analytics.Modules.Entities
{
	public class PersonListModule:IModule 
	{
		public PersonListModule(IUnityContainer container, IRegionManager regionManager)
		{
			Container = container;
			RegionManager = regionManager;
		}

		public IUnityContainer Container { get; private set; }
		public IRegionManager RegionManager { get; private set; }
		

		#region Implementation of IModule

		public void Initialize()
		{
			var personListView = Container.Resolve<PersonListView>();
			RegionManager.Regions["EntityListRegion"].Add(personListView);
            // subscribe event
		    personListView.SubscribeEventHandler(null);
		}

		#endregion
	}
}
